//
// Created by 文道江 on 15/12/1.
// Copyright (c) 2015 文道江. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FZEasyFile/FZEasyFile.h>
#import <SSZipArchive/SSZipArchive.h>
#import "CocoaSecurity.h"
#import "URLSessionManager.h"

@interface UpgradeManger : NSObject

@property(nonatomic) NSInteger currentVersionCode;

@property(strong, nonatomic) NSString *upgradeUrl;

@property(strong, nonatomic) NSString *appId;

@property(strong, nonatomic) NSString *appKey;

- (instancetype)initWithAppId:(NSString *)appId AppKey:(NSString *)apKey upgradeUrl:(NSString *)upgradeUrl;


- (void)checkUpgrade:(BOOL(^)(BOOL newVersion, id info))newVersionCallback done:(void (^)(NSDictionary *versionInfo, NSError *error))callback;

- (void)downloadUpgrade:(NSDictionary *)upgrade Callback:(void (^)(BOOL isSuccess))callback;

- (void)downloadSplashImages:(NSArray *)splashs Callback:(void (^)(BOOL isSuccess))callback;

- (NSString *)localPathWithURL:(NSString *)url;

+ (NSString *)getWebAppUrl;

@end